JAVA = java

JAVAC = javac

COMP_FLAGS = -g -O

RUN_FLAGS =

PROF_FLAGS = -Xrunhprof:cpu=samples,heap=sites

DIRS = ATUC ATUR

.SUFFIXES: .class .java
.java.class:
	$(JAVAC) $(COMP_FLAGS) $<

JSRCS = ADSL.java \
	BroadBandNet.java \
	CustomerNet.java \
	compData.java
	
all: subtree $(JSRCS:%.java=%.class)

subtree:
	@if [ "x$(DIRS)" != "x" ]; then \
		set $(DIRS); \
		for x do \
		    if [ -w $$x ] ; then \
			( cd $$x ; \
			$(MAKE) ;\
			) \
		    fi ; \
		done ; \
	fi
	
run: $(JSRCS)
	$(JAVA) $(RUN_FLAGS) ptij.ADSL.de.ADSL
	$(MAKE) check

runp: $(JSRCS)
	$(JAVA) $(RUN_FLAGS) $(PROF_FLAGS) ptij.ADSL.de.ADSL	

runi: $(JSRCS)
	$(JAVA) $(RUN_FLAGS) ptij.ADSL.de.initTest

runa: $(JSRCS)
	appletviewer ADSL.htm

check:
	$(JAVA) $(RUN_FLAGS) compData
	
cleanall:
	rm -f *class
	rm -rf jsdatabase
	rm -f summary.html

clean: 
	rm -f *.class *.rx *.tx
	
jsinstr:
	$(JSINSTR) $(JSINSTRFLAGS) $(JSRCS)
	$(MAKE) all
	
jsrestore:
	$(JSRESTORE) $(JSRCS)
	-rm -rf jsoriginal
	$(MAKE) clean
	
jssummary:
	$(JSSUMMARY) $(JSSUMMARYFLAGS)
	
jsmerge:
	(cd $(JSDATABASE); $(JSMERGE) $(JSMERGEFLAGS) *.jdd)
